package com.tanhua.manage.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.tanhua.manage.pojo.DayActive;
import com.tanhua.manage.service.DayActiveService;
import com.tanhua.manage.util.NoAuthorization;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 杨一帆
 * @date 2020/12/15  16:16
 */
@RestController
@RequestMapping("/dayActive")
public class DayActiveController {

    @Autowired
    private DayActiveService dayActiveService;

    @GetMapping
    @NoAuthorization
    public IPage<DayActive> getSum(@RequestParam(name = "page", defaultValue = "1") Integer page,
                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                   @RequestParam(name = "startdate", required = false) String startdate,
                                   @RequestParam(name = "evenOrOdd", required = false) Integer evenOrOdd,
                                   @RequestParam(name = "enddate", required = false) String enddate) {


        IPage<DayActive> byPage = this.dayActiveService.findByPage(page, pageSize, startdate, enddate, evenOrOdd);


        return byPage;
    }

}
